home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / MPW IIGS Interfaces / CIIGSIncludes / Sound.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-04-03  |  4.8 KB  |  115 lines  |  [TEXT/MPS ]

  1. /********************************************
  2. ; File: Sound.h
  3. ;
  4. ;
  5. ; Copyright Apple Computer, Inc.1986-90
  6. ; All Rights Reserved
  7. ;
  8. ********************************************/
  9. #ifndef __TYPES__
  10. #include <TYPES.h>
  11. #endif
  12.  
  13. #ifndef __SOUND__
  14. #define __SOUND__
  15.  
  16.  
  17. /* Error Codes */
  18. #define noDOCFndErr 0x0810  /* no DOC chip found */
  19. #define docAddrRngErr 0x0811  /* DOC address range error */
  20. #define noSAppInitErr 0x0812  /* no SAppInit call made */
  21. #define invalGenNumErr 0x0813  /* invalid generator number */
  22. #define synthModeErr 0x0814  /* synthesizer mode error */
  23. #define genBusyErr 0x0815  /* generator busy error */
  24. #define mstrIRQNotAssgnErr 0x0817  /* master IRQ not assigned */
  25. #define sndAlreadyStrtErr 0x0818  /* sound tools already started */
  26. #define unclaimedSndIntErr 0x08FF  /* sound tools already started */
  27.  
  28. /* channelGenMode Codes */
  29. #define ffSynthMode 0x0001  /* Free form synthesizer mode */
  30. #define noteSynthMode 0x0002  /* Note synthesizer mode. */
  31.  
  32. /* genMask Codes */
  33. #define gen0off 0x0001  /* param to FFStopSound */
  34. #define gen1off 0x0002  /* param to FFStopSound */
  35. #define gen2off 0x0004  /* param to FFStopSound */
  36. #define gen3off 0x0008  /* param to FFStopSound */
  37. #define gen4off 0x0010  /* param to FFStopSound */
  38. #define gen5off 0x0020  /* param to FFStopSound */
  39. #define gen6off 0x0040  /* param to FFStopSound */
  40. #define gen7off 0x0080  /* param to FFStopSound */
  41. #define gen8off 0x0100  /* param to FFStopSound */
  42. #define gen9off 0x0200  /* param to FFStopSound */
  43. #define gen10off 0x0400  /* param to FFStopSound */
  44. #define gen11off 0x0800  /* param to FFStopSound */
  45. #define gen12off 0x1000  /* param to FFStopSound */
  46. #define gen13off 0x2000  /* param to FFStopSound */
  47. #define gen14off 0x4000  /* param to FFStopSound */
  48.  
  49. /* genStatus Codes */
  50. #define genAvail 0x0000  /* Generator available status */
  51. #define ffSynth 0x0100  /* Free Form Synthesizer status */
  52. #define noteSynth 0x0200  /* Note Synthesizer status */
  53. #define lastBlock 0x8000  /* Last block of wave */
  54.  
  55. /* Jump Table Offsets */
  56. #define smReadRegister 0x00  /* Read Register routine */
  57. #define smWriteRegister 0x04  /* Write Register routine */
  58. #define smReadRam 0x08  /* Read Ram routine */
  59. #define smWriteRam 0x0C  /* Write Ram routine */
  60. #define smReadNext 0x10  /* Read Next routine */
  61. #define smWriteNext 0x14  /* Write Next routine */
  62. #define smOscTable 0x18  /* Pointer to Oscillator table */
  63. #define smGenTable 0x1C  /* Pointer to generator table */
  64. #define smGcbAddrTable 0x20  /* Pointer to GCB address table */
  65. #define smDisableInc 0x24  /* Disable Increment routine */
  66. struct SoundParamBlock {
  67.    Pointer waveStart; /* starting address of wave */
  68.    Word waveSize; /* waveform size in pages */
  69.    Word freqOffset; /* ? formula to be provided */
  70.    Word docBuffer; /* DOC buffer start address, low byte = 0 */
  71.    Word bufferSize; /* DOC buffer start address, low byte = 0 */
  72.    struct SoundParamBlock *nextWavePtr; /* Pointer to start of next wave's parameter block */
  73.    Word volSetting; /* DOC volume setting. High byte = 0 */
  74. } ;
  75. typedef struct SoundParamBlock SoundParamBlock, *SoundPBPtr, **SoundPBHndl;
  76. struct DocRegParamBlk {
  77.    Word oscGenType; /*   */
  78.    Byte freqLow1; /*   */
  79.    Byte freqHigh1; /*   */
  80.    Byte vol1; /*   */
  81.    Byte tablePtr1; /*   */
  82.    Byte control1; /*   */
  83.    Byte tableSize1; /*   */
  84.    Byte freqLow2; /*   */
  85.    Byte freqHigh2; /*   */
  86.    Byte vol2; /*   */
  87.    Byte tablePtr2; /*   */
  88.    Byte control2; /*   */
  89.    Byte tableSize2; /*   */
  90. } ;
  91. typedef struct DocRegParamBlk DocRegParamBlk, *DocRegParamBlkPtr;
  92. extern pascal Word FFGeneratorStatus() inline(0x1108,dispatcher);
  93. extern pascal void FFSetUpSound() inline(0x1508,dispatcher);
  94. extern pascal Boolean FFSoundDoneStatus() inline(0x1408,dispatcher);
  95. extern pascal Word FFSoundStatus() inline(0x1008,dispatcher);
  96. extern pascal void FFStartPlaying() inline(0x1608,dispatcher);
  97. extern pascal void FFStartSound() inline(0x0E08,dispatcher);
  98. extern pascal void FFStopSound() inline(0x0F08,dispatcher);
  99. extern pascal Word GetSoundVolume() inline(0x0C08,dispatcher);
  100. extern pascal Pointer GetTableAddress() inline(0x0B08,dispatcher);
  101. extern pascal void ReadDOCReg() inline(0x1808,dispatcher);
  102. extern pascal void ReadRamBlock() inline(0x0A08,dispatcher);
  103. extern pascal void SetDOCReg() inline(0x1708,dispatcher);
  104. extern pascal void SetSoundMIRQV() inline(0x1208,dispatcher);
  105. extern pascal void SetSoundVolume() inline(0x0D08,dispatcher);
  106. extern pascal ProcPtr SetUserSoundIRQV() inline(0x1308,dispatcher);
  107. extern pascal void SoundBootInit() inline(0x0108,dispatcher);
  108. extern pascal void SoundReset() inline(0x0508,dispatcher);
  109. extern pascal void SoundShutDown() inline(0x0308,dispatcher);
  110. extern pascal void SoundStartUp() inline(0x0208,dispatcher);
  111. extern pascal Boolean SoundToolStatus() inline(0x0608,dispatcher);
  112. extern pascal Word SoundVersion() inline(0x0408,dispatcher);
  113. extern pascal void WriteRamBlock() inline(0x0908,dispatcher);
  114. #endif
  115.